﻿<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-nested" prefix="nested" %>
<%@ taglib uri="/tags/struts-tiles" prefix="tiles" %>
<%@ page import="cn.bopomo.dealer.base.common.CommonConstant,java.util.*,cn.bopomo.dealer.base.vo.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"><head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>基于SOA的权限管理框架系统</title>
        <link rel="stylesheet" type="text/css" href="../css/sfx.css"/>
		<script language="javascript" src="/js/eventutil.js"></script>
		<script language="javascript" src="/js/detect.js"></script>
        <script language="javascript" type="text/javascript">
//<![CDATA[
var moduleList = "/admin/|/wow/|/uloo/";
<logic:present name="<%=CommonConstant.KEY_MODULE_MAP%>">
	var user_moduleList = "";
	<logic:iterate name="<%=CommonConstant.KEY_MODULE_MAP%>" id="entry">
	<bean:define name="entry" id="module2" property="value"/>
		user_moduleList += <bean:write name="module2" property="moduleAction"/> + "|"
	</logic:iterate> 
</logic:present>
<logic:notPresent name="<%=CommonConstant.KEY_MODULE_MAP%>">
	var user_moduleList = "";
</logic:notPresent>
//var user_moduleList = "/admin/|/test/";
var user_authorizeList = "002|003|";
<logic:present name="<%=CommonConstant.KEY_AUTHORIZE_MAP%>">
	var user_authorizeList = "";
	<logic:iterate name="<%=CommonConstant.KEY_AUTHORIZE_MAP%>" id="entry">
	<bean:define name="entry" id="authorize" property="value"/>
		user_authorizeList += "<bean:write name="authorize" property="authorizeTag"/>" + "|"
	</logic:iterate> 
</logic:present>
<logic:notPresent name="<%=CommonConstant.KEY_AUTHORIZE_MAP%>">
	var user_authorizeList = "";
</logic:notPresent>


function initDiv(divIds){
	var divId = divIds.split("|");
	var modules = moduleList.split("|");

	for (var j=0;j<modules.length;j++){

		var moduleDiv = document.getElementById(modules[j]);
		if (moduleDiv){
			if (user_moduleList.indexOf(modules[j]) != -1){
				moduleDiv.style.display = "block";
				
			}
			else{
				moduleDiv.style.display = "none";
				
				continue;
			}
			//var list = document.getElementsByTagName("li");
			/*
			var list = document.all;
			for (var i=0; i<list.length;i++){
				var value = list[i].getAttribute("ref");
				//alert(value);
				if (value == null)
					continue;
				if (user_authorizeList.indexOf(value) != -1){
					alert(value);
					list[i].style.display = "";
				}else{
					alert(value);
					list[i].style.display = "none";
				}
			}
			*/
		}
	}
	var list = document.all;
	for (var i=0; i<list.length;i++){
		var value = list[i].getAttribute("ref");
		//alert(value);
		if (value == null)
			continue;
		if (user_authorizeList.indexOf(value) != -1){

			list[i].style.display = "";
		}else{

			list[i].style.display = "none";
		}
	}
}

function showNav(divId){
	hideAll();
	var navDiv = document.getElementById(divId + "Nav");
	var div = document.getElementById(divId);
	var left = getPos(div,'Left');
	var top = getPos(div,'Top');
	if (top && left){
		navDiv.style.left = left;
		navDiv.style.top = top + 20;
	}
	if (navDiv)
		if (navDiv.style.display != "block")
			navDiv.style.display= "block";
}

function hideNav(divId){
	
	var navDiv = document.getElementById(divId + "Nav");
	if (navDiv)
		navDiv.style.display= "none";
}

function getPos(el,sProp) { 
    var iPos = 0
    while (el!=null) {
        iPos+=el["offset" + sProp]
        el = el.offsetParent
    }
    return iPos

}
function hideAll() {
	var divs = document.getElementsByTagName("div");
	for (i=0; i<divs.length; i++) {
      if (divs[i].id.indexOf("Nav") != -1) {
        hideObject(divs[i]);
      }
    }
}
function hideObject(element){
	element.style.display = "none";
}
function menuFix() {

 
 initDiv(user_moduleList);
}

var f=0;
var y=0;
var div_obj;
function over(obj){
	//obj += "Nav";
	
	div_obj=obj;
	_f=0;
	y=0;
	document.getElementById(obj).style.width="0px";
	document.getElementById(obj).style.height="1px";
	document.getElementById(obj).style.display="";
	document.getElementById(obj).style.left = EventUtil.getEvent().pageX - 5;
	document.getElementById(obj).style.top = EventUtil.getEvent().pageY - 10;
	timerDIV();
}
function out(obj){
	document.getElementById(obj).style.display="none";
}
function Tout(){
document.getElementById(div_obj).style.display="none";
}
function Tover(){
	document.getElementById(div_obj).style.display="";
}
function timerDIV(){
	if( _f >= 140){/*宽度*/
		objy();
		return ;
	}
	else{
		_f=_f+10;

		document.getElementById(div_obj).style.width=_f+"px";
		window.setTimeout(timerDIV,1);
	}
}
function objy(){
	if(y >= 150){/*高度*/
		var str="<div style=\"width:150px;height:auto;float:left;font-size:12px;margin:6px;line-height:20px\"><a href=\"http://www.showwho.com\">新闻-1</a><br/>&nbsp;&nbsp;<font style=\"color:#7EA9BF;font-size:11px;\">&diams;</font>&nbsp;<a href=\"http://www.showwho.com\" style=\"font-size:11px;\">新闻-1-1</a><br/>&nbsp;&nbsp;<font style=\"color:#7EA9BF;font-size:11px;\">&diams;</font>&nbsp;<a href=\"http://www.showwho.com\" style=\"font-size:11px\">新闻-1-2</a><br/>&nbsp;&nbsp;<font style=\"color:#7EA9BF;font-size:11px;\">&diams;</font>&nbsp;<a href=\"http://www.showwho.com\" style=\"font-size:11px\">新闻-1-3</a><br/><a href=\"http://www.showwho.com\">新闻-2</a><br /><a href=\"http://www.showwho.com\">新闻-3</a><br/><\/div>";
		//document.getElementById(div_obj).innerHTML=str
		//document.getElementById(div_obj).style.display = "";
		return ;
	}
	else{
		y+=6;

		document.getElementById(div_obj).style.height=y+"px";	
		window.setTimeout(objy,1);

	}
}

window.onload=menuFix;
//]]>
</script>
</head>

<html:html>

<div id="wraper">
		<!-- #Begin_TilesItem  -->
			<tiles:insert attribute="header"/>
		<!-- #End_TilesItem -->

		<!-- #Begin_TilesItem  -->
		<tiles:insert attribute="mainMenu"/>
		
		<!-- #End_TilesItem -->



		<!-- #Begin_TilesItem  -->
			<tiles:insert attribute="content"/>
		<!-- #End_TilesItem -->



		<!-- #Begin_TilesItem  -->
			<tiles:insert attribute="footer"/>
		<!-- #End_TilesItem -->
</div>
</body>

</html:html>

